﻿using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HN.WxPayApiV3Partner.Model
{ 
    /// <summary>
    /// 微信支付通过后的响应类
    /// </summary>
    public class V3NotifyModel
    {
        /// <summary>
        /// 通知的唯一ID
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 通知创建的时间，遵循rfc3339标准格式，
        /// </summary>
        public DateTime create_time { get; set; }
        /// <summary>
        /// 通知的资源数据类型，支付成功通知为encrypt-resource
        /// </summary>
        public string resource_type { get; set; }
        /// <summary>
        /// 通知的类型，支付成功通知的类型为TRANSACTION.SUCCESS
        /// </summary>
        public string event_type { get; set; }
        /// <summary>
        /// 回调摘要:如：支付成功
        /// </summary>
        public string summary { get; set; }
        /// <summary>
        /// 通知资源数据 json格式，
        /// </summary>
        public ResourceModel resource { get; set; }
    }

    /// <summary>
    /// 通知资源数据 json格式，
    /// </summary>
    public class ResourceModel
    {
        /// <summary>
        /// 原始回调类型，为transaction
        /// </summary>
        public string original_type { get; set; }
        /// <summary>
        /// 对开启结果数据进行加密的加密算法，目前只支持AEAD_AES_256_GCM
        /// </summary>
        public string algorithm { get; set; }
        /// <summary>
        /// Base64编码后的开启/停用结果数据密文
        /// </summary>
        public string ciphertext { get; set; }
        /// <summary>
        /// 附加数据
        /// </summary>
        public string associated_data { get; set; }
        /// <summary>
        /// 加密使用的随机串
        /// </summary>
        public string nonce { get; set; }
    }
}
